import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.util.Collections;

public class Generator {
    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql://localhost:3306/order?useSSL=false&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2b8", "root", "root")
                .globalConfig(builder -> {
                    builder.author("leotong") // 设置作者
                            .outputDir("/Users/leotong/IdeaProjects/order/src"); // 指定输出目录
                })
                .packageConfig(builder -> {
                    builder.parent("com.leezk.order"); // 设置mapperXml生成路径
                })
                .strategyConfig(builder -> {
                    builder.addInclude("dictionary","menu","orders","student","studentMenuMapper","tagMapper") // 设置需要生成的表名
                            .addTablePrefix("t_", "c_"); // 设置过滤表前缀
                })
                .templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板，默认的是Velocity引擎模板
                .execute();

    }
}
